<template><!-- 每日异常 -->
    <div class="quan">
       <div class="ju">
           <span>居家检测/每日异常</span>
       </div>
       <div class="hh">
           <div class="hh1">
               <el-table :data="tableData" border style="width: 100%" >
           <el-table-column type="index" label="序号" min-width="90px" align="center" />
           <el-table-column  label="姓名"  min-width="110px" align="center" #default="scope">
            <div class="bei"></div>
            <span class="yi">异</span>
            <span>{{ scope.row.name }}</span>
            
           </el-table-column>
           <el-table-column prop="sex" label="性别"  min-width="110px" align="center"/>
           <el-table-column prop="idCard" label="身份证号" min-width="200px"  align="center"/>
           <el-table-column prop="phoneNum" label="联系电话"  min-width="150px" align="center"/>
           <el-table-column prop="exception" label="异常项目"  min-width="150px" align="center"/>
           <el-table-column prop="source" label="来源"  width="150px" align="center"/>
           <el-table-column fixed="right" label="操作" width="264px" align="center" #default="scope">
            <!-- 判断条件为是否密接 -->
            
                <router-link :to="{name:'miqie', query: {id:scope.row.id}}"><el-button link type="primary" size="small">密切跟踪</el-button></router-link>
            
        </el-table-column>
           
        </el-table>
           </div>
           
           
       </div>
       
   
    </div>
   </template>
   
   <script lang="ts">
   import { defineComponent,onBeforeMount, ref, reactive, toRefs } from 'vue'
   import {useRouter} from 'vue-router'
   import axios from '@/views/chen/http'
   export default defineComponent({
       name: "meix",
       setup() {
        let tableData1=reactive({
            tableData : [
               {
                   date: 1,
                   name: '张晓雅', //姓名
                   gender:"女", //性别
                   shen:"2930511229321",//身份证号
                   phone:"13022568213",//联系电话
                   yi:"体温 36.9°",//异常项目
                   source:"核实后转居家检测",//来源
               },
               {
                date: 2,
                   name: '张大雅', //姓名
                   gender:"女", //性别
                   shen:"2930511229321",//身份证号
                   phone:"13022568213",//联系电话
                   yi:"核酸检测:阳性",//异常项目
                   source:"核实后转居家检测",//来源
               },
               {
                date: 3,
                   name: '张小雅', //姓名
                   gender:"女", //性别
                   shen:"2930511229321",//身份证号
                   phone:"13022568213",//联系电话
                   yi:"体温 36.9°",//异常项目
                   source:"手动登记",//来源
               },
               {
                date: 4,
                   name: '张晓雅', //姓名
                   gender:"女", //性别
                   shen:"2930511229321",//身份证号
                   phone:"13022568213",//联系电话
                   yi:"体温 36.9°",//异常项目
                   source:"核实后转居家检测",//来源
               },
           ]
            })
            
           const router=useRouter()
           //按钮
           const handleClick=(index: any)=>{
                   if(index.name=="体温待监测"){
                       router.push({path:'/miqie',query:{key:index.address}})
                   }else if(index.name=="监测待解除"){
                       router.push({path:'/cha',query:{key:index.address}})
                   }
           };
           onBeforeMount(()=>{
            //挂载前获取全部参数
            //展示全部数据
               axios({
                method:"get",url:"diurnalAnomaly/findDayException",
                params:{date:'2023-2-27'}
               }).then((res)=>{
                console.log('====');
                let a=res.data.data;
                tableData1.tableData=a
                console.log(res);
                
                
               })
                
            })
           return{
               ...toRefs(tableData1),
               handleClick,
               router
           }
       }
   })
   
   
   </script>
   
   <style scoped lang="less">
   .hh {
       width: 100%;
       height: 800px;
       background-color: rgb(255, 255, 255);
       
       
   }
   .quan{
       width: 100%;
       height: 700px;
       display: flex;
       flex-direction: column;
   }
   // 设置表头样式
   /deep/ .el-table th{
       background-color: #f9f9f9 !important; 
       color: black;
       Font-weight:400;// 字体粗细
       
       
   }
   
   .hh1{
       margin-top:30px;
       margin-left:35px;
       margin-right:35px
   }
   .ju{
       padding: 20px 0px 20px 0px;
   }
   .bei{
    width: 0;
    height: 0;
    border: 12px solid;
    border-color: rgb(255, 0, 0) rgb(255, 255, 255) rgb(255, 255, 255) rgb(255, 0, 0);
    position: absolute;
    top:0px
   }
   .yi{
    position: absolute;
    top:-6px;
    left:0px;
    font-size:10px;
    color: rgb(255, 255, 255);
   }
  </style>